package online.hxstar.cloud.apllo;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * Apollo 测试
 *
 * @author xinghu
 * @version 1.0
 * @date 2019/12/12 6:42 下午
 */
@Configuration
@SpringBootApplication
@EnableDiscoveryClient
@EnableApolloConfig
@Data
@Slf4j
public class CloudApolloApplication {

	@Value("${configTest:sb}")
	private String configTest;

	public static void main(String[] args) {
		SpringApplication app = new SpringApplication(CloudApolloApplication.class);
		app.run(args);
	}

	@PostConstruct
	public void init() {
		log.info("apollo configTest----->>{}", this.configTest);
	}
}
